﻿using System.Threading.Tasks;

namespace JsonRpcRT.RemoteMethodsHandling
{
    public class RemoteMethodRequestHandler : BaseRemoteHandler
    {
        public object Result { get; set; }

        public RemoteMethodRequestHandler(JsonRpcController networkManager) : base(networkManager)
        {
        }

        public virtual void ParseResponse(MethodResponse response)
        {            
        }

        protected async Task<MethodResponse> Send()
        {
            return NetworkManager == null
                       ? null
                       : await NetworkManager.SendRequestAsync(GetMethodName(), MethodParams);
        }
    }
}